package com.common.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.common.api.annontation.ServiceLog;
import com.common.api.model.PageModel;
import com.common.web.api.service.RequestErrorLogService;
import com.common.web.api.dto.RequestErrorLogDto;

import com.common.web.annotation.ControllerRequest;
import com.common.web.dto.request.FuzzyPageDTO;
import com.common.web.dto.response.RestResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * <p>
 * 请求异常日志前端控制器
 * </p>
 *
 * @author system
 */
@ServiceLog
@ControllerRequest("/requestErrorLog/")
@Api(tags = "系统工具-异常日志服务接口")
public class RequestErrorLogController {

	@Autowired
	private RequestErrorLogService requestErrorLogService;
	
	/**
	 * @param fuzzyPageDTO
	 * @return
	 */
    @ApiOperation(value = "查询请求异常日志集合")
    @RequestMapping(value="queryList")
    public RestResponse queryList(@RequestBody FuzzyPageDTO fuzzyPageDTO) {
      	PageModel<RequestErrorLogDto> page= requestErrorLogService.queryList(fuzzyPageDTO);
        return RestResponse.success("查询请求异常日志集合成功!").setData(page);
    }
        	
	/**
	 * @param idList
	 * @return
	 */
	@RequestMapping(value="dels")
	@ApiOperation(value ="根据主键批量删除请求异常日志")
    public RestResponse dels(@RequestBody List<String> idList) {
		int count= requestErrorLogService.dels(idList);	
		return RestResponse.success("根据主键批量删除请求异常日志成功!").setData(count);
    }
	
}
